﻿using System;
using System.Xml.Serialization;
using Utils;

namespace Limestone
{
    [Serializable]
    [XmlRoot("Template", Namespace = "http://www.limestone.se", IsNullable = false)]
    public class PageTemplate: IPageTemplate
    {
        [XmlAttribute]
        public string Name { get; set; }
        /// <summary>
        /// The path always begins with a / and includes the template name and ends with .template (the /sys/templates  prefix should not be added)
        /// </summary>
        [XmlAttribute]
        public string Path { get; set; }
        [XmlAttribute]
        public string HelpText { get; set; }
        [XmlArray("Fields")]
        [XmlArrayItem("Field", Type = typeof(AbstractXmlSerializer<FieldSetting>))]
        public FieldSettingCollection FieldSettings { get; set; }

        public PageTemplate()
        {
            FieldSettings = new FieldSettingCollection();
        }

    }
}
